const object1 = {
    [Symbol.toPrimitive](hint) {
        console.log(hint);
      if (hint === 'number') {
        return 42;
      }
      return 'object1';
    }
  };
  
console.log(+object1);
// expected output: 42
  
Symbol.toPrimitive
Symbol.toStringTag

Object.isExtensible();
Object.